package com.johnguo.beam_test.write.producer;

import java.util.Map;

import org.apache.beam.sdk.transforms.SerializableFunction;
import org.apache.kafka.clients.producer.KafkaProducer;
import org.apache.kafka.clients.producer.Producer;

public class ProducerFactoryFn implements SerializableFunction<Map<String, Object>, Producer<String, String>> {

	private static final long serialVersionUID = 1L;

	@Override
	public Producer<String, String> apply(Map<String, Object> input) {
		Producer<String, String> producer = new KafkaProducer<String, String>(input);
		return producer;
	}

}
